from django.db import models

class User(models.Model):
    username=models.CharField(max_length=100,unique=True)
    password=models.CharField(max_length=100)
    enum=models.IntegerField(choices=[(1,"管理员"),(2,"普通用户")])
    createtime=models.DateTimeField()
class tushufenlei(models.Model):
    tushuname=models.CharField(max_length=100)
    fenid=models.IntegerField(primary_key=True)
    createtime1=models.DateTimeField()
class tushu(models.Model):
    tuname=models.CharField(max_length=100)
    fenid=models.ForeignKey(tushufenlei,on_delete=models.CASCADE,related_name="childes")
    price=models.FloatField()
    num=models.IntegerField()
    createxgtime=models.DateTimeField()




